<?php


namespace addon\hotel\hotel\controller;

use addon\hotel\model\Config as ConfigModel;

class Config extends BaseHotel
{
    public function agreement()
    {
        if (request()->isAjax()) {
            //设置注册协议
            $title = input('title', '');
            $content = input('content', '');
            $config_model = new ConfigModel();
            return $config_model->setRefundRuleInDocument($title, $content,$this->hotel_id);
        } else {
            //获取注册协议
            $config_model = new ConfigModel();
            $document_info = $config_model->getRefundRuleInDocument($this->hotel_id);
            $this->assign('document_info', $document_info);

            return $this->fetch('config/agreement');
        }
    }
}